//
//  File.swift
//
//
//  Created by didi on 2022/9/13.
//

import Fluent
import Foundation

struct SystemVariableRepository: MolecularModelRepository {
    typealias DatabaseModel = SystemVariableModel

    public private(set) var db: Database

    init(_ db: Database) {
        self.db = db
    }
}

extension SystemVariableRepository {
    func find(_ key: String) async throws -> DatabaseModel? {
        try await query().filter(\.$key == key).first()
    }
}
